xen.git
18 years agohvm: Allow GNTTABOP_query_size.
kfraser@localhost.localdomain [Thu, 31 May 2007 09:53:11 +0000 (10:53 +0100)]
hvm: Allow GNTTABOP_query_size.
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix stale email addresses in xenstat and xentop.
kfraser@localhost.localdomain [Thu, 31 May 2007 09:42:34 +0000 (10:42 +0100)]
Fix stale email addresses in xenstat and xentop.

Our @us.ibm.com emails cannot forward to us; we do not have access to
them when not interning at IBM.  People have attempted to reach us via
those addresses and failed; occasionally they've Googled for a current
address, which made us realize the problem.  Change each email to a
more permanent address, so people can reach us in the future.  Change
bug reporting addresses to a xen mailing list rather than an
individual.

Signed-off-by: Josh Triplett <josh@kernel.org>
18 years agoFix the very-slow-IDE-IO-speed issue of Qemu 0.90
kfraser@localhost.localdomain [Thu, 31 May 2007 09:30:15 +0000 (10:30 +0100)]
Fix the very-slow-IDE-IO-speed issue of Qemu 0.90

c/s 15021 updated Qemu to 0.90. In the new Qemu's ide.c, asynchronous
IO (AIO) is used to replace the previous DMA thread; here when an AIO
request is completed, dom0 sends a signal SIGUSR2 to Qemu (see
block-raw.c: qemu_aio_init(),raw_aio_setup()), then the signal
interrupts the select() in main_loop_wait() at once, next,
qemu_aio_poll() is called to reap a completed AIO request.

However, in certain Linux distributions (i.e., x86_64 RHEL 4u4), if
Qemu is spawned by the python script image.py of Control Panel, the
SIGUSR2 of Qemu is blocked by default due to some reasons (i.e. it
seems Python 2.3.4 has this issue; 2.4.2 is ok); so in most cases the
select() in main_loop_wait() can only time out in 10ms, then the
qemu_aio_poll() is called - this results in a very slow disk IO
speed...

This patch ensures aio_sig_num is unblocked when the AIO is used in
Qemu 0.90.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agohvm: Correctly hook VLAPIC MSR change notification for VMX into
kfraser@localhost.localdomain [Thu, 31 May 2007 08:49:53 +0000 (09:49 +0100)]
hvm: Correctly hook VLAPIC MSR change notification for VMX into
save/restore path.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoRemove 'hpet_force' option. Replace with 'clocksource' option to allow
kfraser@localhost.localdomain [Wed, 30 May 2007 17:29:21 +0000 (18:29 +0100)]
Remove 'hpet_force' option. Replace with 'clocksource' option to allow
forced selection of platform clocksource, overriding the default
priority ordering.

Usage: clocksource={pit,hpet,cyclone,acpi}

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAdd support for ACPI PM Timer as platform clock source.
kfraser@localhost.localdomain [Wed, 30 May 2007 17:12:02 +0000 (18:12 +0100)]
Add support for ACPI PM Timer as platform clock source.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoClean up around domain init/destroy.
kfraser@localhost.localdomain [Wed, 30 May 2007 16:47:00 +0000 (17:47 +0100)]
Clean up around domain init/destroy.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoMake header mismatch checking more robust against build time changes in
Ian Campbell [Wed, 30 May 2007 16:37:58 +0000 (17:37 +0100)]
Make header mismatch checking more robust against build time changes in
xen/include/public/foreign.

Unfortunately diff's -x and -X options do not support excluding paths just
individual files so we have to list unqualified filenames. This is ok for now
since there are no filename clashes.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoSimplify APIC_ACCESS VMX support.
kfraser@localhost.localdomain [Wed, 30 May 2007 16:01:26 +0000 (17:01 +0100)]
Simplify APIC_ACCESS VMX support.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAdd VMX memory-mapped Local APIC access optimization.
kfraser@localhost.localdomain [Wed, 30 May 2007 15:48:28 +0000 (16:48 +0100)]
Add VMX memory-mapped Local APIC access optimization.

Some operating systems access the local APIC TPR very frequently, and
we handle that using software-based local APIC virtualization in Xen
today. Such virtualization incurs a number of VM exits from the
memory-access instructions against the APIC page in the guest.

The attached patch enables the TPR shadow feature that provides APIC
TPR virtualization in hardware. Our tests indicate it can
significantly boost the performance of such guests including 32-bit
Windows XP/2003.

Moreover, with the patch, local APIC accesses other than TPR in guests
are intercepted directly as APIC_ACCESS VM exits rather than
PAGE_FAULT VM exits; this can lower the emulation cost of such
accesses.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agoCheck for mismatch between headers shared by Linux and Xen.
Ian Campbell [Wed, 30 May 2007 12:10:20 +0000 (13:10 +0100)]
Check for mismatch between headers shared by Linux and Xen.

This is only enabled for the linux-2.6-xen tree and is intended to
ensure that the separate Linux tree stays up to date once we
switch away from the sparse tree.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoFix preemption of multicalls in compat mode.
Ian Campbell [Wed, 30 May 2007 10:55:38 +0000 (11:55 +0100)]
Fix preemption of multicalls in compat mode.

mcs->call (struct multicall_entry) always needs to be translated into
mcs->compat_call (struct compat_multicall_entry) when a multicall is
preempted in compat mode. Previously this translation only occured for
those hypercalls which explicitly called hypercall_xlat_continuation()
which doesn't cover all hypercalls which could potentially be
preempted.

Change hypercall_xlat_continuation() to only translate only the
hypercall arguments themselves and not the multicall_entry
layout. Translate the layout for all hypercalls in in
compat_multicall() instead.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years ago[NET] back: Add lazy copying
kfraser@localhost.localdomain [Wed, 30 May 2007 09:47:05 +0000 (10:47 +0100)]
[NET] back: Add lazy copying

This patch adds lazy copying using the new unmap_and_replace grant
table operation.

We keep a list of pending entries sorted by arrival order.  We'll
process this list every time net_tx_action is invoked.  We ensure
that net_tx_action is invoked within one second of the arrival of
the first packet in the list.

When we process the list any entry that has been around for more
than half a second is copied.  This allows up to free the grant
table entry and return it to domU.

If the new grant table operation is not available (e.g., old HV
or architectures that don't support it yet) we simply copy each
packet as we receive them using skb_linearize.  We also disable
SG/TSO if this is the case.

By default the new code is disabled.  In order to enable it,
the module needs to be loaded with the argument copy_skb=1.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18 years ago[LINUX] gnttab: Add basic DMA tracking
kfraser@localhost.localdomain [Wed, 30 May 2007 09:46:13 +0000 (10:46 +0100)]
[LINUX] gnttab: Add basic DMA tracking

This patch adds basic tracking of outstanding DMA requests on
grant table entries marked as PageForeign.

When a PageForeign struct page is about to be mapped for DMA,
we set its map count to 1 (or zero in actual value).  This is
then checked for when we need to free a grant table entry early
to ensure that we don't free an entry that's currently used for
DMA.

So any entry that has been marked for DMA will not be freed early.

If the unmapping API had a struct page (which exists for the sg
case) then we could do this properly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18 years ago[XEN] gnttab: Add new op unmap_and_replace
kfraser@localhost.localdomain [Wed, 30 May 2007 09:45:44 +0000 (10:45 +0100)]
[XEN] gnttab: Add new op unmap_and_replace

The operation unmap_and_replace is an extension of unmap_grant_ref.
A new argument in the form of a virtual address (for PV) is given.
Instead of modifying the PTE for the mapped grant table entry to
null, we change it to the PTE for the new address.  In turn we
point the new address to null.

As it stands grant table entries once mapped cannot be
remapped by the guest OS (it can however perform a new
mapping on the same entry but that is within our control).
Therefore it's safe to manipulate the mapped PTE entry to
redirect it to a normal page where we've copied the contents.

It's intended to be used as follows:

1) map_grant_ref to v1
2) ...
3) alloc page at v2
4) copy the page at v1 to v2
5) unmap_and_replace v1 with v2

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Added compat integration (PAE-on-64).

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxend: Don't destroy domains on shutdown timeout.
kfraser@localhost.localdomain [Wed, 30 May 2007 09:06:23 +0000 (10:06 +0100)]
xend: Don't destroy domains on shutdown timeout.

Do not destroy domains on shutdown timeout: the administrator needs to
be able to decide what to do if a domain does not shut down.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agoFix xenstore entry accounting
kfraser@localhost.localdomain [Wed, 30 May 2007 09:04:23 +0000 (10:04 +0100)]
Fix xenstore entry accounting

xenstored is incorrectly accounting domain nodes when transactions
fail. Store pending count changes in the transaction structure, and
apply at transaction completion, instead of directly applying the
changes.

Signed-off-by: Max Zhen <max.zhen@sun.com>
18 years agoFix xen build on NetBSD.
kfraser@localhost.localdomain [Wed, 30 May 2007 08:59:09 +0000 (09:59 +0100)]
Fix xen build on NetBSD.
From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxen: Remove assumption that first NUMA node to be discovered is node0.
kfraser@localhost.localdomain [Wed, 30 May 2007 08:51:38 +0000 (09:51 +0100)]
xen: Remove assumption that first NUMA node to be discovered is node0.

Based on a patch by Alex Williamson.

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agopv-on-hvm: Re-init hypercall stubs page after HVM save/restore.
kfraser@localhost.localdomain [Fri, 25 May 2007 16:26:26 +0000 (17:26 +0100)]
pv-on-hvm: Re-init hypercall stubs page after HVM save/restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Sanitise the MFN passed to mod_l1_entry().
kfraser@localhost.localdomain [Fri, 25 May 2007 15:06:36 +0000 (16:06 +0100)]
x86: Sanitise the MFN passed to mod_l1_entry().
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoCorrect 32on64 handling of VCPUOP_register_runstate_memory_area. We
Ian Campbell [Fri, 25 May 2007 14:28:52 +0000 (15:28 +0100)]
Correct 32on64 handling of VCPUOP_register_runstate_memory_area.  We
were copying too many bytes from the guest so the test for
area.addr.h.c != area.addr.p was failing.

Added a WARN_ON to the kernel to catch this case. It would be a BUG_ON
but this would break the new kernel on older hypervisors and the only
real problem is that stolen time is not updated, which we can live
with.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoRevert 15164:d93e560c1d50afcf39c99a4211c20c8b9ce63c38
kfraser@localhost.localdomain [Fri, 25 May 2007 12:41:01 +0000 (13:41 +0100)]
Revert 15164:d93e560c1d50afcf39c99a4211c20c8b9ce63c38

18 years agoxend: Fix PAM authentication method for some versions of PyPAM.
kfraser@localhost.localdomain [Fri, 25 May 2007 12:02:08 +0000 (13:02 +0100)]
xend: Fix PAM authentication method for some versions of PyPAM.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoLINUX/x86_64: Cleanup 15129:a40967e39652 by using __pgd rather than
Ian Campbell [Fri, 25 May 2007 10:24:02 +0000 (11:24 +0100)]
LINUX/x86_64: Cleanup 15129:a40967e39652 by using __pgd rather than
abusing mk_kernel_pgd.

Also set the user bit on the vsyscall entry in the user pgd.

Both changes suggested by Jan Beulich.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoFactor out sparse tree makefile fragments and introduce hg-clone and
Ian Campbell [Fri, 25 May 2007 10:03:40 +0000 (11:03 +0100)]
Factor out sparse tree makefile fragments and introduce hg-clone and
tarball methods in preparation for migrating away from the sparse tree
layout.

This re-introduces 14883:6568c1882af5 and 14862:98efd2e410ae plus
further fixes.

Also add makefile fragments to support building the paravirt ops tree
(make linux-2.6-paravirt-build).

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoxend: Fix checkname so that it detects duplicate domains.
kfraser@localhost.localdomain [Fri, 25 May 2007 09:53:07 +0000 (10:53 +0100)]
xend: Fix checkname so that it detects duplicate domains.
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years ago[XEND/XM] Improve error reporting in 'xm restore'.
kfraser@localhost.localdomain [Fri, 25 May 2007 09:23:16 +0000 (10:23 +0100)]
[XEND/XM] Improve error reporting in 'xm restore'.
From: Mats Petersson <Mats.Petersson@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agolinux: Fix PV-on-HVM crash when installing PV drivers on native system.
kfraser@localhost.localdomain [Fri, 25 May 2007 09:17:43 +0000 (10:17 +0100)]
linux: Fix PV-on-HVM crash when installing PV drivers on native system.
From: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxend: Increase shutdown timeout.
kfraser@localhost.localdomain [Fri, 25 May 2007 09:16:00 +0000 (10:16 +0100)]
xend: Increase shutdown timeout.

30 seconds is not a very long time for a busy domain to cleanly
shutdown all its services, which may be arbitrary in
complexity. Increase the timeout to 5 minutes.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agoDo not destroy domains that timeout when shutting down.
kfraser@localhost.localdomain [Fri, 25 May 2007 09:15:37 +0000 (10:15 +0100)]
Do not destroy domains that timeout when shutting down.

Instead of violently destroying a domain that is not responding to a
shutdown request, rename the domain to indicate the problem and leave
it alone; this allows the admin to make corrective actions (which may
or may not include destroying the domain).

Signed-off-by: John Levon <john.levon@sun.com>
18 years agoxm: Extend width of ID in 'xm list' to 5 digits.
kfraser@localhost.localdomain [Thu, 24 May 2007 14:45:43 +0000 (15:45 +0100)]
xm: Extend width of ID in 'xm list' to 5 digits.

The Domain ID is currently expected to fit in 3 digits.

When doing extensive testing on SAVE/RESTORE I can easily get ID's
into the 4-digit range, which makes some of the formatting to get out
of sync. Extend the width to 5 digits (and change some %-ns to %ns, as
the ID for example is right justified, %-ns is left-justified, which
didn't look too good).

Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agoxm-test: ia64 min memory & arbitrarily large ramdisk
kfraser@localhost.localdomain [Thu, 24 May 2007 14:40:54 +0000 (15:40 +0100)]
xm-test: ia64 min memory & arbitrarily large ramdisk

1) Sets a minimum of 128MB RAM for an ia64 domU; this limit was set
after experimentation, which seems to indicate it's a reasonable lower
limit (the 32MB limit previously in place did not allow an ia64 domU
to start).  If there's any problem with this, I don't mind splitting
the patch and sending it to the ia64 list, but it was small, so I hope
it's okay to include it.

2) xm-test uses ramdisks built with uClibc, which doesn't compile on
ia64.  I was able to create a ramdisk by hand, but as it was too
large, the resultant domU crashed after boot.  This patch enables the
use of an arbitrarily large ramdisk, so long as it's uncompressed.  As
xm-test builds only uncompressed ramdisks, I figured this was
reasonable for that specific application.  Suggestions on how to
detect and handle a compressed ramdisk would be welcome.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years agoxend: Give "xm start" a -c parameter for connecting to the console
kfraser@localhost.localdomain [Thu, 24 May 2007 14:36:13 +0000 (15:36 +0100)]
xend: Give "xm start" a -c parameter for connecting to the console
From: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxend: Add site-packages into Python search path
kfraser@localhost.localdomain [Thu, 24 May 2007 14:30:05 +0000 (15:30 +0100)]
xend: Add site-packages into Python search path
Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
18 years agoVTPM: Fix bug where enabling vtpm causes installation error
kfraser@localhost.localdomain [Thu, 24 May 2007 14:29:11 +0000 (15:29 +0100)]
VTPM: Fix bug where enabling vtpm causes installation error
Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
18 years agoioemu: Attempt to setup tap interface up to 3 times.
kfraser@localhost.localdomain [Thu, 24 May 2007 14:25:35 +0000 (15:25 +0100)]
ioemu: Attempt to setup tap interface up to 3 times.

As there is a (small) chance that vl.c:tap_open() fails (due to some
sort of race-condition in the Linux kernel, which is noted as a bug in
the source .../net/core/dev.c), we should attempt it again a couple of
times if it doesn't succeed on the first attempt. I think three times
in total is sufficient to avoid the problem.

If tap_open() fails, qemu-dm will exit, which means that the domain
dies - which is not such a good thing when attempting to restore a saved
domain [of course, it would be even worse if it started, but didn't
have networking - because there may not be a way to shut it down
cleanly without network].

Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agoxend: Fix for removing devices at save/destroy domain.
kfraser@localhost.localdomain [Thu, 24 May 2007 14:21:29 +0000 (15:21 +0100)]
xend: Fix for removing devices at save/destroy domain.

The function XendDomainInfo:_releaseDevices() is called during the
save/destroy phase of a domain. It made some attempt to clean up the
devices, but wasn't complete, leaving dangling devices in the
xenstore. Not a big problem with normal use of Xen, but a buildup over
a large number of save/destroy instances, it would make the xenstore
database grow quite large, which in turn meant swap-thrashing in Dom0.

This patch makes use of the destroyDevices() function in
XendDomainInfo. This function needed some re-writing to make it work
correctly - I think it had some old code (not sure how old, as xm
annotate says that it's changeset 12071, but that, I think, is when it
was split out from XendDomain.py, rather than when it was created).

I have tested this over a few hundred save/restore cycles [two domains
constantly saved/restored with a short sleep to let them process some
work] combined with a loop of "xenstore-ls|wc". The output of the
latter is pretty much constant (it obviously varies a bit depending on
when in the save/restore cycle it hits). Previously, it would increase
by some 10 lines or so per save/restore cycle.

Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agolinux/x86: consolidate pte_val/p[mug]d_val replacements
kfraser@localhost.localdomain [Thu, 24 May 2007 14:13:13 +0000 (15:13 +0100)]
linux/x86: consolidate pte_val/p[mug]d_val replacements

 - replace incomplete pXX_val_ma() set with complete __pXX_val() set
 - use __pXX_val() instead of pXX_val() when only flags are accessed or
   the frame number is only compared against zero

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agolinux/x86-64: force _PAGE_NX on the 1:1 mapping (matching native)
kfraser@localhost.localdomain [Thu, 24 May 2007 14:12:31 +0000 (15:12 +0100)]
linux/x86-64: force _PAGE_NX on the 1:1 mapping (matching native)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agoblktap: Fix compile errors
kfraser@localhost.localdomain [Thu, 24 May 2007 13:07:40 +0000 (14:07 +0100)]
blktap: Fix compile errors

When compiling the various blktap drivers with warnings cranked up, I
get errors that return values are not checked.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
18 years agoxend: Tear down domain if device hotplug fails during startup
kfraser@localhost.localdomain [Thu, 24 May 2007 13:05:58 +0000 (14:05 +0100)]
xend: Tear down domain if device hotplug fails during startup

If creating an unmanaged guest (eg xm create), if device hotplug fails
during the startup of the guest, then the guest will be torn down
again. If creating and starting a managed guest (eg xm new && xm
start), then if device hotplug fails, the still born guest gets left
in 'paused' state. This confuses users no end, who go an unpause and
then get all upset when it shortly crashes (due to lack of disk or
network devices).

The attached patch fixes XenDomain.py's domain_start() method so that
if waitForDevices() fails, then the entire domain is torn down. This
is the same approach used in xm create.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
18 years agoxend: Fix CPU affinity reset across save/restore.
kfraser@localhost.localdomain [Thu, 24 May 2007 13:02:09 +0000 (14:02 +0100)]
xend: Fix CPU affinity reset across save/restore.
Fixes bug #936.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agoConsole daemon - remove duplicate include.
kfraser@localhost.localdomain [Thu, 24 May 2007 12:58:01 +0000 (13:58 +0100)]
Console daemon - remove duplicate include.
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agosvm: Replace call to svm_load_cr2 with conditional call to svm_trace_vmentry
kfraser@localhost.localdomain [Thu, 24 May 2007 12:56:58 +0000 (13:56 +0100)]
svm: Replace call to svm_load_cr2 with conditional call to svm_trace_vmentry

Remove the call to svm_load_cr2 (which doesn't do anything useful).
The old svm_load_cr2 is now replaced with a svm_trace_vmentry. A call
to this function is done if "tb_init_done" is non-zero, so we don't call
this unless it's actually being used.

Signed-off-by: Mats Petersson <mats.petersson@amd.com>
18 years agoxend: Fix scheduler parameters of rebooted domain
kfraser@localhost.localdomain [Thu, 24 May 2007 12:45:47 +0000 (13:45 +0100)]
xend: Fix scheduler parameters of rebooted domain

When I changed the scheduler parameters of a domain with
xm sched-credit, the information of xm sched-credit was changed.
But as for the information of xm list, the values of the domain
configuration definition were kept.
And, then I rebooted the domain. The information of xm list was
not changed. But as for the information of xm sched-credit, the
values of the domain configuration definition were returned.

# xm create /xen/PVdomain.1 cpu_cap=150 cpu_weight=512
Using config file "/xen/PVdomain.1".
Started domain PVdomain.1
# xm sched-credit -d PVdomain.1
Name                              ID Weight Cap
PVdomain.1                         1    512  150
# xm sched-credit -d PVdomain.1 -c 75 -w 384
# xm sched-credit -d PVdomain.1
Name                              ID Weight Cap
PVdomain.1                         1    384   75
# xm list --long PVdomain.1 | grep cpu_
    (cpu_weight 512)
    (cpu_cap 150)
    (cpu_time 29.353831745)
# xm reboot PVdomain.1
# xm sched-credit -d PVdomain.1
Name                              ID Weight Cap
PVdomain.1                         2    512  150
# xm list --long PVdomain.1 | grep cpu_
    (cpu_weight 512)
    (cpu_cap 150)
    (cpu_time 5.950247186)

If the scheduler parameters of the domain were changed with
xm sched-credit, I think that xm list should show the current
values about the scheduler parameters.
And, then if the domain is rebooted, I think that the rebooted
domain should keep the preceding values about the scheduler
parameters.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agovmxassist: Fix some copy-and-paste mistakes in vmx_check_descriptor()
kfraser@localhost.localdomain [Thu, 24 May 2007 12:42:41 +0000 (13:42 +0100)]
vmxassist: Fix some copy-and-paste mistakes in vmx_check_descriptor()
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agoCleanups to map_vcpu_info.
kfraser@localhost.localdomain [Thu, 24 May 2007 12:42:16 +0000 (13:42 +0100)]
Cleanups to map_vcpu_info.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agovnc: Fix Zenkaku_Hankaku and add deadkey keysyms
kfraser@localhost.localdomain [Thu, 24 May 2007 12:34:19 +0000 (13:34 +0100)]
vnc: Fix Zenkaku_Hankaku and add deadkey keysyms
Signed-off-by: Pat Campbell <plc@novell.com>
18 years agomerged
Jeremy Fitzhardinge [Thu, 24 May 2007 12:32:03 +0000 (13:32 +0100)]
merged

18 years agosvm: Handle MC4_MISC threshold register for guests
kfraser@localhost.localdomain [Thu, 24 May 2007 12:30:29 +0000 (13:30 +0100)]
svm: Handle MC4_MISC threshold register for guests

The threshold register has been introduced in AMD RevF CPUs along with
SVM (Actually this MCA/MCE msr register existed before, but had no
meaning). Therefore no need for additional cpuid checks.

On read access it reports the HVM guest the register has been locked
by the BIOS. This means, it is not available for OS use. Thus, write
accesses are simply ignored. This behaviour actually matches real HW,
so guests can deal with this.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
18 years agoUnmap vcpu_info mapping in arch_domain_destroy.
Jeremy Fitzhardinge [Thu, 24 May 2007 12:25:05 +0000 (13:25 +0100)]
Unmap vcpu_info mapping in arch_domain_destroy.

We don't need to touch it in arch_vcpu_reset() because that's only used
to recover from a failed suspend, and the correct behaviour there is to
leave the mapping as-is.

18 years agoClean up map_domain_page().
kfraser@localhost.localdomain [Thu, 24 May 2007 10:33:39 +0000 (11:33 +0100)]
Clean up map_domain_page().
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoblktap: Add one more error reason statement to blktapctrl
kfraser@localhost.localdomain [Thu, 24 May 2007 09:50:07 +0000 (10:50 +0100)]
blktap:  Add one more error reason statement to blktapctrl

blktapctrl already prints out exits reasons for all goto's to
open_failed except of not finding a device number for blktap0
This patch adds just that message so the user will get more info than
just "Unable to start blktapctrl"
Common source of this issue is that blktap is missing/failed to
load/...

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
18 years agomerged
Jeremy Fitzhardinge [Thu, 24 May 2007 09:48:58 +0000 (10:48 +0100)]
merged

18 years agoImplement VCPUOP_register_vcpu_info
Jeremy Fitzhardinge [Thu, 24 May 2007 09:47:27 +0000 (10:47 +0100)]
Implement VCPUOP_register_vcpu_info

This change implements the VCPUOP_register_vcpu_info vcpu_op.  This
allows a guest to choose where each VCPU's vcpu_info structure is
placed within its address space, allowing it to put it somewhere which
is easily accessible via some per-cpu data access mechanism.

When changing the mapping of the vcpu info, there's no obvious way to
prevent the other vcpus from getting a stale pointer of the vcpu_info,
which could result in them accessing bad memory (stale pointers to the
shared_info page are not a problem, because its always valid).  To
avoid this, we prevent guests from changing the vcpu_info location
more than once, since there's no obvious need to allow them to do this
at this point.

(If we really want to allow guests to update the vcpu_info location
more than once, then some sort of RCU wait between updating the
pointer and performing the unmap may be the way to do it.)

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
18 years agolinux: Fix mem= kernel parameter when it is smaller than initial memory allocation.
kfraser@localhost.localdomain [Thu, 24 May 2007 09:46:57 +0000 (10:46 +0100)]
linux: Fix mem= kernel parameter when it is smaller than initial memory allocation.
From: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoMake map_domain_page_global fail
Jeremy Fitzhardinge [Thu, 24 May 2007 09:45:03 +0000 (10:45 +0100)]
Make map_domain_page_global fail

When the global mapping cache runs out, make map_domain_page_global
return NULL on failure rather than fire an assertion failure.  This
also updates the callers to handle the error gracefully.

The only exception to this is the shadow pagetable code, which uses
map_domain_page_global to create a mapping for
v->arch.paging.shadow.guest_vtable; it's not clear this needs to be a
global mapping anyway.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
18 years agoblktap: Do not install libs or headers with execute permissions.
kfraser@localhost.localdomain [Thu, 24 May 2007 09:44:01 +0000 (10:44 +0100)]
blktap: Do not install libs or headers with execute permissions.

rpmlint complains that various blktap files are installed with
unnecessary execute permissions:
E: xen-devel spurious-executable-perm (Badness: 100)
/usr/lib64/libblktap.a
E: xen-devel spurious-executable-perm (Badness: 100)
/usr/include/blktaplib.h

Signed-off-by: Charles Coffing <ccoffing@novell.com>
18 years agox86: Prevent an infinite series of traps
kfraser@localhost.localdomain [Thu, 24 May 2007 09:39:28 +0000 (10:39 +0100)]
x86: Prevent an infinite series of traps

In some cases, we can end up in a vicious cycle of fatal_trap()s
within fatal_trap()s. Panic after a certain number of attempts.

Signed-off-by: Nils Nieuwejaar <nils.nieuwejaar@sun.com>
Use a per-cpu depth variable.

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[ACM] Simpler interface to hypercalls
kfraser@localhost.localdomain [Thu, 24 May 2007 09:18:55 +0000 (10:18 +0100)]
[ACM] Simpler interface to hypercalls

Implement a simpler interface for the hypercalls to ACM. I put the
parameters to all hypercalls into a union. On top of this I have
implemented a shim layer for enabling ACM hypercalls on PPC.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agoblktap: Small changes to blktap + add a hook to clear ptes on implicit release of...
kfraser@localhost.localdomain [Thu, 24 May 2007 09:14:05 +0000 (10:14 +0100)]
blktap: Small changes to blktap + add a hook to clear ptes on implicit release of VMAs.

 * free memory on release
 * invalidate p2m entry when unmapping grants
 * check for alloc failure of idx_map
 * add DONTCOPY vma flag
 * hook for clearing ptes when a vma is freed by the kernel

From: Geoffrey Lefebvre <geoffrey@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoia64: nvram setup.
kfraser@localhost.localdomain [Thu, 24 May 2007 08:54:03 +0000 (09:54 +0100)]
ia64: nvram setup.
From: "Zhang, Xing Z" <xing.z.zhang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agomerge
Ian Campbell [Thu, 24 May 2007 08:15:58 +0000 (09:15 +0100)]
merge

18 years agoLINUX/x86_64: Ensure that the initial page tables allow userspace
Ian Campbell [Thu, 24 May 2007 08:14:43 +0000 (09:14 +0100)]
LINUX/x86_64: Ensure that the initial page tables allow userspace
mappings of the vsyscall page. This matches native behaviour by
setting the U bit on the L2-L4 page table entries and controlling
access using the L1 entries.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoRevert 15127:98cf6c05c32a59ad3f4fcd505ca60348589e6096
kfraser@localhost.localdomain [Thu, 24 May 2007 08:10:43 +0000 (09:10 +0100)]
Revert 15127:98cf6c05c32a59ad3f4fcd505ca60348589e6096
Breaks 64-bit build.

18 years agoThis patch fixes the issue with waiting for devices to disconnect during the end
Steven Hand [Tue, 22 May 2007 14:32:50 +0000 (15:32 +0100)]
This patch fixes the issue with waiting for devices to disconnect during the end
stage of migration in Xend. The problem was cause by a deletion of the VM domain
ID which is used by testDevicecompleComplete ->deviceIDs->backendRoot() to get
the virtual backend device path. The virtual backend device path is used to
check if a device still exists in xenstore.

Signed-off-by: Yung Giang <yung.giang@gmail.com>
18 years agoImplement VCPUOP_register_vcpu_info
Jeremy Fitzhardinge [Tue, 22 May 2007 13:48:56 +0000 (14:48 +0100)]
Implement VCPUOP_register_vcpu_info
This change implements the VCPUOP_register_vcpu_info vcpu_op.  This
allows a guest to choose where each VCPU's vcpu_info structure is
placed within its address space, allowing it to put it somewhere which
is easily accessible via some per-cpu data access mechanism.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
18 years agoMerge with xen-ia64-unstable.hg
kfraser@localhost.localdomain [Tue, 22 May 2007 05:43:05 +0000 (06:43 +0100)]
Merge with xen-ia64-unstable.hg

18 years agovmxassist: Include terminating 0xff byte in TSS I/O bitmap.
Keir Fraser [Sun, 20 May 2007 18:05:10 +0000 (19:05 +0100)]
vmxassist: Include terminating 0xff byte in TSS I/O bitmap.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[BLKTAP] Ensure blktap doesn't try to re-create extant sysfs entries
Jake Wires [Sat, 19 May 2007 17:54:01 +0000 (10:54 -0700)]
[BLKTAP] Ensure blktap doesn't try to re-create extant sysfs entries
Signed-off-by: Jake Wires <jwires@xensource.com>
18 years agoAdded tag 3.1.0-branched for changeset d2ef85c6bf84cc619ca2d42c2edfc6229e70a6ad
kfraser@localhost.localdomain [Fri, 18 May 2007 16:01:20 +0000 (17:01 +0100)]
Added tag 3.1.0-branched for changeset d2ef85c6bf84cc619ca2d42c2edfc6229e70a6ad

18 years agoFix default return value for VM_Metrics.get_state
Tom Wilkie [Thu, 17 May 2007 10:42:46 +0000 (11:42 +0100)]
Fix default return value for VM_Metrics.get_state

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

18 years agoFix recent XenRT Failure re: xm block-list via XenAPI
Tom Wilkie [Thu, 17 May 2007 10:18:58 +0000 (11:18 +0100)]
Fix recent XenRT Failure re: xm block-list via XenAPI

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

18 years agoAdded xeninfo.pl, a script for collecting statistics from Xen hosts using the
Ewan Mellor [Wed, 16 May 2007 22:12:16 +0000 (23:12 +0100)]
Added xeninfo.pl, a script for collecting statistics from Xen hosts using the
Xen-API.  This also serves as a good example of the use of XML::RPC::Client
with the Xen-API.

By Ingard Mevåg <ingard [at] mevaag [dot] no>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
18 years ago[IA64] Update struct checker for ia64 changes
Alex Williamson [Wed, 16 May 2007 17:38:48 +0000 (11:38 -0600)]
[IA64] Update struct checker for ia64 changes

This makes use of the union support to work with our new
vcpu_guest_context struct.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years ago[IA64] Fix trivial compiler warning
Alex Williamson [Wed, 16 May 2007 17:37:19 +0000 (11:37 -0600)]
[IA64] Fix trivial compiler warning

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years agomerge with xen-unstable.hg
Alex Williamson [Wed, 16 May 2007 16:59:01 +0000 (10:59 -0600)]
merge with xen-unstable.hg

18 years ago[IA64] Fix deadlock of ptc.ga emulation
Alex Williamson [Wed, 16 May 2007 16:42:07 +0000 (10:42 -0600)]
[IA64] Fix deadlock of ptc.ga emulation

ptc_ga_remote_func() might be invoked by IPI with a schedule_lock
that is acquired. (e.g., inside of vcpu_migrate())
It will cause a deadlock.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years agolinux: Un-__init a couple of kexec vars that are accessed after init time.
kfraser@localhost.localdomain [Wed, 16 May 2007 08:57:29 +0000 (09:57 +0100)]
linux: Un-__init a couple of kexec vars that are accessed after init time.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agostatic, __init and __initdata symbols in machine_kexec.c
Simon Horman [Wed, 16 May 2007 08:15:54 +0000 (09:15 +0100)]
static, __init and __initdata symbols in machine_kexec.c
Some symbols in machine_kexec.c really ought to be static and,
marked __init or __initdata.

Signed-off-by: Simon Horman <horms@verge.net.au>
18 years ago[IA64] Optimizations for windows
Alex Williamson [Tue, 15 May 2007 21:32:23 +0000 (15:32 -0600)]
[IA64] Optimizations for windows

Windows use region 4 and region 5 for identity mapping.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
18 years ago[XEND] Write the default ABI to the xenstore entry for each frontend
Ian Campbell [Tue, 15 May 2007 18:00:48 +0000 (19:00 +0100)]
[XEND] Write the default ABI to the xenstore entry for each frontend
device.

This allows to run older kernels in a 32on64 mixed environment.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years ago[BUILDER] Propagate the native protocol ABI for a guest out of the
Ian Campbell [Tue, 15 May 2007 16:54:48 +0000 (17:54 +0100)]
[BUILDER] Propagate the native protocol ABI for a guest out of the
domain builder and in to python code.

This knowledge will be useful to allow us to pre-seed the protocol
field in a VBD entry in xenstore which will allow us to run older
kernels in a 32on64 mixed environment.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoAdd some fields from XenAPI docs to implementation.
Tom Wilkie [Tue, 15 May 2007 16:01:57 +0000 (17:01 +0100)]
Add some fields from XenAPI docs to implementation.
Add stefan's patch to swap mtu and mac, so they're correct.

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

18 years ago[HVM][SVM] Reintroduce ASIDs.
kfraser@localhost.localdomain [Tue, 15 May 2007 14:14:02 +0000 (15:14 +0100)]
[HVM][SVM] Reintroduce ASIDs.

ASIDs partition the physical TLB for SVM.  In the current implementation
ASIDs are used to reduce the number of TLB flushes.  Each time the
guest's virtual address space changes (e.g. due to an INVLPG,
MOV-TO-{CR3, CR4} operation), instead of flushing the TLB, a new ASID is
assigned.  This reduces the number of TLB flushes to at most 1/#ASIDs
(currently 1/64).  The biggest advantage is that hot parts of the
hypervisor's code and data remain in the TLB.

From: Sebastian Biemueller <Sebastian.Biemueller@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix TPM support in HVM domains
kfraser@localhost.localdomain [Tue, 15 May 2007 09:50:09 +0000 (10:50 +0100)]
Fix TPM support in HVM domains
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: Peter Yang <peisen.yang@intel.com>
18 years agoxenapi: Small fix to the host.get_name_description call
kfraser@localhost.localdomain [Tue, 15 May 2007 09:49:10 +0000 (10:49 +0100)]
xenapi: Small fix to the host.get_name_description call
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agox86/hvm: HVM_DBG_LOG() cleanup
kfraser@localhost.localdomain [Tue, 15 May 2007 09:46:43 +0000 (10:46 +0100)]
x86/hvm: HVM_DBG_LOG() cleanup

- make log levels used consistent in a few places
- remove trailing newlines, dots, and commas
- remove explictly specified function names from message text

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agovmx: remove CSTAR save/restore on VMX
kfraser@localhost.localdomain [Tue, 15 May 2007 09:46:03 +0000 (10:46 +0100)]
vmx: remove CSTAR save/restore on VMX

CSTAR is an unused MSR in 64-bit mode on Intel's EM64T, hence there's
no need to save/restore this MSR during context switches. Mimic real
hardware by retaining the value written for eventual guest OS reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86/hvm: add logging for hypercalls
kfraser@localhost.localdomain [Tue, 15 May 2007 09:43:59 +0000 (10:43 +0100)]
x86/hvm: add logging for hypercalls
Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86: fix EFER handling
kfraser@localhost.localdomain [Tue, 15 May 2007 09:43:18 +0000 (10:43 +0100)]
x86: fix EFER handling

Introduce a per-CPU shadow of what is currently in EFER, as context
switch code must re-write this MSR so that all guests run with
appropriate EFER.SCE and EFER.NX settings. Remove EFER from the set of
MSRs that VMX deals with in a generic fashion.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86/hvm: hypercall adjustments
kfraser@localhost.localdomain [Tue, 15 May 2007 09:28:28 +0000 (10:28 +0100)]
x86/hvm: hypercall adjustments

- share more code between 32- and 64-bit variants
- properly handle continuations for 32-bit guests on 64-bit hv
- properly handle preemption (this must *not* rely on regs->eip, as
- other code may overwrite the value there by calling
- hvm_store_cpu_guest_regs()
- deny hypercall access when called from guest in vm86 mode, which
  requires that ???_guest_x86_mode() make real and vm86 modes distinguishable

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86-64/hvm: pio result storing
kfraser@localhost.localdomain [Tue, 15 May 2007 09:13:11 +0000 (10:13 +0100)]
x86-64/hvm: pio result storing

Don't clear upper 32 bits on 8- and 16-bit PIO reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86: ptwr adjustments
kfraser@localhost.localdomain [Tue, 15 May 2007 09:12:02 +0000 (10:12 +0100)]
x86: ptwr adjustments

Make sure MFN read from pte is valid before accessing the page info
structure associated with it. Drop guest-to-machine-physical
translation from ptwr code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86: replace some intpte_t * casts
kfraser@localhost.localdomain [Tue, 15 May 2007 09:08:20 +0000 (10:08 +0100)]
x86: replace some intpte_t * casts

Don't cast values when other (type safe) mechanisms are available to =
achieve the same effect.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agox86: kill unused local variable sh_mapcache
kfraser@localhost.localdomain [Tue, 15 May 2007 09:03:58 +0000 (10:03 +0100)]
x86: kill unused local variable sh_mapcache
Apparently a leaf-over from pre-3.0.3.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agotools: check for curl-devel and libxml2-devel
kfraser@localhost.localdomain [Tue, 15 May 2007 09:03:14 +0000 (10:03 +0100)]
tools: check for curl-devel and libxml2-devel
when they are required for LIBXENAPI_BINDINGS.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years agotools: check for libvncserver dependency libraries
kfraser@localhost.localdomain [Tue, 15 May 2007 09:01:14 +0000 (10:01 +0100)]
tools: check for libvncserver dependency libraries
Signed-off-by: Jan Beulich <jbeulich@novell.com>
18 years ago64-bit hvm on 32-bit dom0 - ioemu adjustments
kfraser@localhost.localdomain [Tue, 15 May 2007 08:59:51 +0000 (09:59 +0100)]
64-bit hvm on 32-bit dom0 - ioemu adjustments

Don't mask off data bits when running 64-bit hvm guests on 32-bit dom0.

Signed-off-by: Jan Beulich <jbeulich@novell.com>